<?php
//$str=curl('https://www.hc360.com/hots/900020772.html');
//采集入库
//$str1=curl('https://zhilicup.b2b.hc360.com/shop/company.html');
////echo $str;
//$str1=iconv('gbk','UTF-8',$str1);
////$str1=curl('https://www.hc360.com/supplyself/390806475.html');
////echo $str1;
//$preg='#<div class="cConpanyName">.*<div class="contact3Btn">#isU';
//preg_match($preg,$str1,$arr);
////print_r($arr);die;
//$preg_arr='#<div class="cConpanyName">(.*)</div>.*<div class=".*">.*<em class=".*">.*</em>.*<span>联系人</span>：</div>.* <div class="con3Rig">.*<span>.*<a href=".*" .*>(.*)</a>&nbsp;&nbsp;（总经理）</span>.*</div>.*<div class="con3Left"><em class="telephoneIco"></em><span>电话</span>：</div>.*<div class="con3Rig" node-name="telephone">(.*)</div>.*<div class="con3Left"><em class="mobileIco"></em><span >手机</span>：</div>.*<div class="con3Rig" node-name="mp">(.*)</div>#isU';
//preg_match_all($preg_arr,$arr[0],$arr_info);
//foreach($arr_info[1] as $k=>$value)
//{
//    $arr_tt['company_name']=$arr_info[1][$k];
//    $arr_tt['people_name']=$arr_info[2][$k];
//    $arr_tt['tel']=$arr_info[3][$k];
//    $arr_tt['phone']=$arr_info[4][$k];
//    $dbh=new PDO('mysql:host=localhost;dbname=gaofei','root','root');
//    $sql="insert into company (company_name,people_name,tel,phone) VALUES('{$arr_tt['company_name']}','{$arr_tt['people_name']}','{$arr_tt['tel']}','{$arr_tt['phone']}')";
//    $dbh->exec($sql);
//}

//$str1=curl('https://b2b.hc360.com/supplyself/390806475.html');
////echo $str;
//$str1=iconv('gbk','UTF-8',$str1);
////$str1=curl('https://www.hc360.com/supplyself/390806475.html');
////echo $str1;
//$preg='#<div class="mainnav">.*<div class="proTitCon">#isU';
//
//preg_match($preg,$str1,$arr);
////print_r($arr);die;
//$preg_arr='#<td>.*<a onclick="(.*)" >.*</a>.*</td>#isU';
//
//preg_match_all($preg_arr,$arr[0],$arr_info);
//print_r($arr_info);die;


//联系我们url地址
//$str1=curl('https://b2b.hc360.com/supplyself/390806475.html');
////echo $str;
//$str1=iconv('gbk','UTF-8',$str1);
////$str1=curl('https://www.hc360.com/supplyself/390806475.html');
////echo $str1;
//$preg='#<div class="mainnav">.*<div class="proTitCon">#isU';
//
//preg_match($preg,$str1,$arr);
////print_r($arr);die;
//$preg_arr='#<td>.*<a onclick="(.*)" >.*</a>.*</td>#isU';
//
//preg_match_all($preg_arr,$arr[0],$arr_info);
//print_r($arr_info);die;
function curl($url)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    $str1=curl_exec($ch);
    return $str1;
}
